-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug: When using dynamic linking, auth will be loaded repeatedly. #27
Conversation
joii2020
commented
Dec 8, 2023
•
edited
Loading
edited
- ckb-auth-rs: Add features to control dynamic linking and CKBDLContext in static memory
- C language: supports dynamic loading of multiple ckb-auth
- Fix bug: When using dynamic linking, auth will be loaded repeatedly.
- Update tests/README.md
c/ckb_auth.h
Outdated
@@ -120,19 +120,24 @@ typedef int (*ckb_auth_validate_t)(uint8_t auth_algorithm_id, | |||
uint32_t pubkey_hash_size); | |||
|
|||
static uint8_t g_code_buff[300 * 1024] __attribute__((aligned(RISCV_PGSIZE))); | |||
static void* g_code_handle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init it to zero.
@@ -9,8 +9,14 @@ edition = "2021" | |||
default = [] | |||
ckb2023 = ["ckb-std/ckb2023"] | |||
|
|||
enable-dynamic-library = ["lazy_static"] | |||
dynamic-library-memory-200 = ["enable-dynamic-library"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use this feature as default.
@@ -9,8 +9,14 @@ edition = "2021" | |||
default = [] | |||
ckb2023 = ["ckb-std/ckb2023"] | |||
|
|||
enable-dynamic-library = ["lazy_static"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use this feature as default
Add more comments
If defined, dynamic library is disabled.
if (buf_offset % RISCV_PGSIZE != 0) { | ||
buf_offset += RISCV_PGSIZE - buf_offset % RISCV_PGSIZE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double check it.